package com.second.controller;

import com.second.entity.Users;
import com.second.servers.UsersServers;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/users")
public class testController {
    @Resource
    private UsersServers servers;
    @GetMapping("/hello")
    public String getString(){
        return "springboot";
    }
    @GetMapping("/allUsers")
    public List<Users> getAllUsers(){
        return servers.getAllUsers();
    }
    @GetMapping("/usersById")
    public Users getUsersById(@RequestParam String id){
        System.out.println("dasdasdasdasdasdasd");
        return servers.getUsersById(id);
    }
}
